/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package core;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Administrator
 */
public class UserLevel {
    private static String[] userLevel =
    {
        "Administrator",
        "User"
    };

    public static String getLevelName(int level)
    {
        if(level < userLevel.length && level >= 0)
        return userLevel[level];
        else return "invalid userLevel";
    }

    public static String[] getUserLevelNames()
    {
        return userLevel;
    }

    public static int getLevelId(String levelName)
    {
        int i = 0;
        for(String name: userLevel)
        {
            if (name.equals(levelName))
                return i;
            i++;
        }
        return -1;
    }

    public static List<String> getUserLevelNamesByList() {
       ArrayList<String> list = new ArrayList<String>();
       for(String string: userLevel)
       {
           list.add(string);
       }
           return list;
    }
}
